package com.sias.swagger.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sias.swagger.mapper.UserMapper;
import com.sias.swagger.model.domain.User;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 吴文杰
 * @version 1.0
 * @createTime 2023-05-19 10:54:13
 */
@RestController
@RequestMapping("/role")
@Slf4j
@Api(tags = "角色管理")
public class RoleController {

  @Resource
  UserMapper userMapper;

  @PostMapping("/getUserById/{id}")
  public User getRoleById(@PathVariable("id") long id) {
    QueryWrapper<User> wrapper = new QueryWrapper<>();
    wrapper.eq("id",id);
    return userMapper.selectOne(wrapper);
  }

  @PostMapping("/test")
  public String test() {
    return "test";
  }
}
